<?php
/***********************************************************************
 * @package    IvanEngine
 * @subpackage Core
 * @author     Ivan <ivanzx@msn.com>
 * @created    2010-05-13
 ***********************************************************************/
if(defined("IVANENGINE_CORE_STL_VECTOR"))
	die("Redefinition macro in :".__FILE__."(".__LINE__.")");
define("IVANENGINE_CORE_STL_VECTOR", true);

require_once (dirname(__FILE__).'/Array.php');

class CVector extends CArray
{
	public function __construct(array & $array = null) 
	{
		parent::__construct($array);
	}

	public function __destruct()
	{
		parent::__destruct();
	}
	
	//---------------------------------------------------------------
	// self function
	
	public function PushFront($val)
	{
		$this->Insert(0, $val);
	}
	
	public function PushBack($val)
	{
		$this->Add($val);
	}
	
	public function PopFront()
	{
		if($this->IsEmpty())
			return null;
			
		$tempVal = $this->Get(0);
		$this->Remove(0);
		return $tempVal;
	}
	
	public function PopBack()
	{
		if($this->IsEmpty())
			return null;
			
		return array_pop($this->m_array);
	}
}

?>